<?php
namespace Admin\Controller;
use Think\Controller;
class ResellerwithdrawController extends CommonController {
	
 	public function _initialize(){
	parent::_initialize();
	//导航母页面显示
	$this->assign("display_nav","reseller");
	$this->model="affiliateWithdraw".YEAR;
	$this->key="aw_id";	
	$this->title_index= L('index');
	$this->title_details=L('details');
	}

	public function updateHandle(){
		if(I("aw_status")==1)
			$this->error(L("operation_forbiden"));
		
		//调用对账单方法
		if(I("aw_status")==3){
		$result=resellerStatement(I("aw_aff_id"),6,I("aw_amount"),"Withdraw voided");
		//resellerStatement($aff_id,$type,$amount,$remark,$fee=0)
		if(!$result)
			$this->error(L("action_failed"));
		}
			parent::updateHandle();
		
	}	
	
}